package com.ruoyi.training.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.training.mapper.ClassConsumableMapper;
import com.ruoyi.training.domain.ClassConsumable;
import com.ruoyi.training.service.IClassConsumableService;

/**
 * 班级耗材明细Service业务层处理
 * 
 * @author WorrilessGo
 * @date 2025-09-24
 */
@Service
public class ClassConsumableServiceImpl implements IClassConsumableService 
{
    @Autowired
    private ClassConsumableMapper classConsumableMapper;

    /**
     * 查询班级耗材明细
     * 
     * @param classConsumableId 班级耗材明细主键
     * @return 班级耗材明细
     */
    @Override
    public ClassConsumable selectClassConsumableByClassConsumableId(String classConsumableId)
    {
        return classConsumableMapper.selectClassConsumableByClassConsumableId(classConsumableId);
    }

    /**
     * 查询班级耗材明细列表
     * 
     * @param classConsumable 班级耗材明细
     * @return 班级耗材明细
     */
    @Override
    public List<ClassConsumable> selectClassConsumableList(ClassConsumable classConsumable)
    {
        return classConsumableMapper.selectClassConsumableList(classConsumable);
    }

    /**
     * 新增班级耗材明细
     * 
     * @param classConsumable 班级耗材明细
     * @return 结果
     */
    @Override
    public int insertClassConsumable(ClassConsumable classConsumable)
    {
        classConsumable.setCreateTime(DateUtils.getNowDate());
        return classConsumableMapper.insertClassConsumable(classConsumable);
    }

    /**
     * 修改班级耗材明细
     * 
     * @param classConsumable 班级耗材明细
     * @return 结果
     */
    @Override
    public int updateClassConsumable(ClassConsumable classConsumable)
    {
        classConsumable.setUpdateTime(DateUtils.getNowDate());
        return classConsumableMapper.updateClassConsumable(classConsumable);
    }

    /**
     * 批量删除班级耗材明细
     * 
     * @param classConsumableIds 需要删除的班级耗材明细主键
     * @return 结果
     */
    @Override
    public int deleteClassConsumableByClassConsumableIds(String[] classConsumableIds)
    {
        return classConsumableMapper.deleteClassConsumableByClassConsumableIds(classConsumableIds);
    }

    /**
     * 删除班级耗材明细信息
     * 
     * @param classConsumableId 班级耗材明细主键
     * @return 结果
     */
    @Override
    public int deleteClassConsumableByClassConsumableId(String classConsumableId)
    {
        return classConsumableMapper.deleteClassConsumableByClassConsumableId(classConsumableId);
    }
}
